﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BI.CF.Model;
using BI.CF.PageList;
using System.Data.SqlClient;
using System.Data;
using BI.CF.IDAL;


namespace BI.CF.DAL
{
   public class MemInvest_DAL :MemInvest_IDAL
    {
       /// <summary>
       /// 某一标所有投资信息
       /// </summary>
       /// <param name="id"></param>
       /// <returns></returns>
       public List<MemInvestModel> Get_MemInvest(string id)
       {
           SqlParameter[] Paramter = { new SqlParameter("@MemLoanId", SqlDbType.VarChar) };
            Paramter[0].Value = id;
           SqlDataReader dt = DbHelperSQL.RunProcedure("PROC_MemInvest_One",Paramter);
           List<MemInvestModel> li = new List<MemInvestModel>();
           while (dt.Read())
           {
               MemInvestModel m = new MemInvestModel();
               m.InvestMoney = decimal.Parse(dt["InvestMoney"].ToString());
               m.InvestTime = DateTime.Parse(dt["InvestTime"].ToString());
               m.MemInvestId = int.Parse(dt["MemInvestId"].ToString());
               m.MemLoanId = int.Parse(dt["MemLoanId"].ToString());
               m.UserName = dt["UserName"].ToString();
               li.Add(m);
           }
           return li;
       }
    }
}
